package org.study.collection;

import java.util.*;

/**
 * 作用描述
 *
 * @author doveylovey
 * @version v1.0.0
 * @email 1135782208@qq.com
 * @date 2024年07月30日
 */
public class SetTests {
    public static void main(String[] args) {
        testSet01();
        testSet02();
    }

    public static void testSet01() {
        Set<String> strSet = new HashSet<>();
        strSet.add("Apple");
        strSet.add("Banana");
        strSet.add("Cherry");
        String[] array = strSet.toArray(new String[0]);
        System.out.println(Arrays.toString(array));
    }

    public static void testSet02() {
        Set<String> strSet = new HashSet<>();
        strSet.add("Apple");
        strSet.add("Banana");
        strSet.add("Cherry");
        System.out.println(strSet);
    }
}
